package com.itbaizhan.exception;

import com.itbaizhan.result.CodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author spf
 * @date 2024/2/13
 * @time 16:39
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusException extends RuntimeException{
    private Integer code;
    private String message;

    public BusException(CodeEnum codeEnum){
        this.code = codeEnum.getCode();
        this.message = codeEnum.getMessage();
    }
}
